How to execute? [closed]
Posted
by
Viswa
on Ask Ubuntu
See other posts from Ask Ubuntu
or by Viswa
Published on 2012-07-10T14:30:25Z
Indexed on
2012/07/10
15:23 UTC
Read the original article
Hit count: 226
python
Possible Duplicate:
how to read the password from variable?
I did the below code in my python script,but its not work.
#! /usr/bin/python
import os
address = "rsync -avrz [email protected]:/opt/script/python/data/ /opt/script/python/data/"
passwd ="my server password"
os.system('%(address)s "echo %(passwd)s"' %locals())
it throws below error.
If arg is a remote file/dir, prefix it with a colon (:).
rsync error: syntax or usage error (code 1) at main.c(1236) [Receiver=3.0.7]
If i run os.system('%(address)s' %locals())
means it work without any error but it ask password. I need that password should be read from my passwd variable.
How to write python script to read server password from my variable.
© Ask Ubuntu or respective owner